﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace aucn.web
{
    public partial class ImageWithH1 : System.Web.UI.UserControl
    {
        string imageUrl = string.Empty, h1Content = string.Empty, imageAlt = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        //public ImageWithH1(string imgUrl, string imgAlt, string h1)
        //{
        //    this.imageAlt = imgAlt;
        //    this.imageUrl = imgUrl;
        //    this.h1Text = h1;
        //}

        public string ImageAltText
        {
            get { return this.imageAlt; }
            set { this.imageAlt = value; this.image.AlternateText = value; this.image.Attributes["title"] = value; }
        }

        public string ImageUrl
        {
            get { return this.imageUrl; }
            set 
            { 
                this.imageUrl = value; 
                this.image.ImageUrl = string.Format("~/au/ImageSizeHandler.ashx?u={0}", value); 
            }
        }

        public string H1Content
        {
            get { return this.h1Content; }
            set { this.h1Content = value; this.H1Text.Text = value; }
        }
    }
}